<?php 
header('Content-Type:text/html;charset=gbk');
require_once("db_manage.php");
require_once '../bbs/include/common.inc.php';

$module = $_GET['module'];
$scope = $_GET['scope'];
// my food list
$area = $_GET['area'];
$state = $_GET['state'];
if($module=='travel'&&$scope=='all'){
	if($area!=""&&$state==""){
		$sql = "select * from pcd_travel,cdb_members where postuser = uid and area = ".$area;	
	}else if($area==""&&$state!=""){
		$sql = "select * from pcd_travel,cdb_members where postuser = uid and state = ".$state;	
	}else if($area!=""&&$state!=""){
		$sql = "select * from pcd_travel,cdb_members where postuser = uid and area = ".$area." and state = ".$state;	
	}else{
		echo "<script>location.href='manage_home_approve_food.php';</script>";
	}	
	echo "<script>location.href='manage_home_approve_travel.php?filter=filter&sql=".$sql."';</script>";
}else if($module=='food'&&$scope=='my'){
	if($area!=""&&$state==""){
		$sql = "select * from pcd_food,cdb_members where postuser = ".$discuz_uid." and postuser = uid and area = ".$area;	
	}else if($area==""&&$state!=""){
		$sql = "select * from pcd_food,cdb_members where postuser = ".$discuz_uid." and postuser = uid and state = ".$state;	
	}else if($area!=""&&$state!=""){
		$sql = "select * from pcd_food,cdb_members where postuser = ".$discuz_uid." and postuser = uid and area = ".$area." and state = ".$state;	
	}else{
		echo "<script>location.href='manage_list_food.php';</script>";
	}	
	echo "<script>location.href='manage_list_food.php?filter=filter&sql=".$sql."';</script>";
}else if($module=='food'&&$scope=='all'){
	if($area!=""&&$state==""){
		$sql = "select * from pcd_food,cdb_members where postuser = uid and area = ".$area;	
	}else if($area==""&&$state!=""){
		$sql = "select * from pcd_food,cdb_members where postuser = uid and state = ".$state;	
	}else if($area!=""&&$state!=""){
		$sql = "select * from pcd_food,cdb_members where postuser = uid and area = ".$area." and state = ".$state;	
	}else{
		echo "<script>location.href='manage_home_approve_food.php';</script>";
	}	
	echo "<script>location.href='manage_home_approve_food.php?filter=filter&sql=".$sql."';</script>";
}
?>